if( $this->iscontent ) {
$nskey = $this->getNameSpaceKey();
- $content_actions[$nskey] = array('class' => (!Namespace::isTalk( $wgTitle->getNamespace())) ? 'selected' : false,
+ $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
+ if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
+ $content_actions[$nskey] = array('class' => ($is_active) ? 'selected' : false,
'text' => wfMsg($nskey),
'href' => $this->makeArticleUrl($this->thispage));
}
}
- if ( $wgUseValidation && /*$wgUser->getID() != 0 && */ $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
+ # Show validate tab
+ if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
global $wgArticle ;
$article_time = "×tamp=" . $wgArticle->mTimestamp ;
$content_actions['validate'] = array('class' => ($action == 'validate') ? 'selected' : false ,
function validate_form ( $article_title = "" )
{
- global $wgOut, $wgLang, $wgUser;
+ global $wgOut, $wgLang, $wgUser, $wgArticle ;
if ( $wgUser->getID() == 0 ) # Anon
{
if ( $rad != -1 ) wfQuery( $sql, DB_WRITE );
}
}
+ $wgArticle->showArticle( "Juhuu", wfMsg( 'val_validated' ) );
+ return ; # Show article instead of validation page
}
# Generating HTML
$skin = $wgUser->getSkin() ;
$staturl = $skin->makeSpecialURL ( "validate" , "mode=stat_page&article_title={$article_title}" ) ;
- $html .= "<a href=\"{$staturl}\">" . wfMsg('val_stat_link_text') . "</a><br>\n" ;
+ $listurl = $skin->makeSpecialURL ( "validate" , "mode=list_page" ) ;
+ $html .= "<a href=\"{$staturl}\">" . wfMsg('val_stat_link_text') . "</a> \n" ;
+ $html .= "<a href=\"{$listurl}\">" . wfMsg('val_article_lists') . "</a><br>\n" ;
$html .= "<small>" . wfMsg('val_form_note') . "</small><br>\n" ;
# Generating data tables
$html .= "</tr></table></form>\n" ;
}
- global $wgArticle ;
$html .= "<h2>" . wfMsg ( 'preview' ) . "</h2>" ;
$wgOut->addHTML ( $html ) ;
$wgOut->addWikiText ( $wgArticle->getContent( true ) ) ;
# Generating HTML
$html = "<h1>Page validation statistics</h1>\n" ;
+
+ $skin = $wgUser->getSkin() ;
+ $listurl = $skin->makeSpecialURL ( "validate" , "mode=list_page" ) ;
+ $html .= "<a href=\"{$listurl}\">" . wfMsg('val_article_lists') . "</a><br><br>\n" ;
+
$html .= "<table border=1 cellpadding=2 style='font-size:8pt;'>\n" ;
$html .= "<tr><th>" . wfMsg('val_version') . "</th>" ;
foreach ( $validationtypes AS $idx => $title )
else $num = 0 ;
return $num ;
}
+
+ function getArticleList ()
+ {
+ }
}
else $mode = "form" ;
$v = new Validation ;
$html = "" ;
- if ( $mode == "form" )
+/* if ( $mode == "form" )
{
$html = $v->validate_form () ;
}
- else if ( $mode == "stat_page" )
+ else */
+ if ( $mode == "stat_page" )
{
$html = $v->getPageStatistics () ;
}
+ else if ( $mode == "list_page" )
+ {
+ $html = $v->getArticleList () ;
+ }
$wgOut->addHTML( $html ) ;
}
'val_user_validations' => 'This user has validated $1 pages.',
'val_no_anon_validation' => 'You have to be logged in to validate an article.',
'val_validate_article_namespace_only' => 'Only articles can be validated. This page is <i>not</i> in the article namespace.',
+'val_validated' => 'Validation done.',
+'val_article_lists' => 'List validated articles',
# Move page
#